<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript" src="ext-2.2/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="ext-2.2/ext-all.js"></script>
 <SCRIPT type=text/javascript>
          	function checkLogin(){
    		var loginName = document.getElementById("loginName").value;
    		var loginPass = document.getElementById("loginPass").value;
    		if(loginName==""){
    			alert("请填写邮箱!!");
    			return;
    		}
    		if(loginPass==""){
    			alert("请填写密码");
    			return;
    		}
    	   Ext.Ajax.request({ 
                      //请求地址 
                      url: 'user!login.do', 
                      //提交参数组 
                      params: { 
                          Uemail : loginName,
                          Upassword : loginPass
                      }, 
                      //成功时回调 
                      success: function(response, options) { 
                         //获取响应的json字符串 
                        var responseArray = Ext.util.JSON.decode(response.responseText);                                               
                             if(responseArray.success==true){ 
                            	window.location.href="mains.jsp";
                             } 
                             else{ 
                                alert('邮箱或密码错误,请重新登录！');      
                             } 
                     } 
             }); 
    		
    	}
    	
   		document.onkeydown = function(evt){
			var evt = window.event?window.event:evt;
			if(evt.keyCode==13)
			{
				checkLogin();
			}
		}
    </script>
<div id="c1ys">
<p style="height:22px;">用户名：<input   id="loginName" type="text"  name="Uemail"  style="border:#7f9db9 1px solid; height:22px; width:150px;"></p>
<p style="height:22px; margin-top:5px;">密&nbsp;&nbsp;&nbsp;&nbsp;码：<input id="loginPass" type="password" name="Upassword"  style="border:#7f9db9 1px solid; height:22px; width:150px;" ></p>
<p>

<table width="204" border="0" cellspacing="0" cellpadding="0" align="center" style="margin-top:7px;">
  <tr>
    <td width="100"><!-- <input name="" type="checkbox" value="" />自动登录 --></td> 
    <td width="180"><input name="" type="button" onclick="checkLogin()" style="width:70px; height:22px; background:url(images/dl.gif) no-repeat; border:0;" /></td>
  </tr>
</table>
 
</p>
<p style="height:25px; text-align:center; margin-top:15px;"><a href="register.jsp"><font style="color:red">免费注册</font></a>&nbsp;<!-- |&nbsp;<a href="#">忘记密码</a>--></p> 
</div>